/**
 * @project_name staff_vehicle
 * @package_name com.ssh.ser.fcvm
 * @desc TODO
 * @param
 * @author jack
 * @date 2013-4-30
 * @time 下午8:49:31
 */
package com.ssh.backup;

import com.ssh.dao.DLicenceDAOI;
import com.ssh.dao.FcarApllyDAOI;
import com.ssh.dao.FcarDriverDAOI;
import com.ssh.dao.VehicleDAOI;
import com.ssh.entity.DLicence;
import com.ssh.entity.FcarAplly;
import com.ssh.entity.FcarDriver;
import com.ssh.entity.Vehicle;

/**
 * @author jack
 * @desc 长期出入地方车申请办卡服务
 */
public class FVApplySerImpl implements FVApplySerI {
	private DLicenceDAOI dLicenceDAOI ;
	private FcarApllyDAOI fcarApllyDAOI;
	private VehicleDAOI vehicleDAOI ;
	private FcarDriverDAOI  fcarDriverDAOI ;

	/**
	 * @return the dLicenceDAOI
	 */
	public DLicenceDAOI getdLicenceDAOI() {
		return dLicenceDAOI;
	}

	/**
	 * @return the fcarApllyDAOI
	 */
	public FcarApllyDAOI getFcarApllyDAOI() {
		return fcarApllyDAOI;
	}

	@Override
	public FcarAplly iWantToFInOut() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public FcarAplly iWantToFInOut(FcarAplly fcarAplly) {
		// TODO Auto-generated method stub
		DLicence dli=fcarAplly.getDLicence();
		dli=dLicenceDAOI.addDLicence(dli);
		return fcarApllyDAOI.addFcarAplly(fcarAplly);
	}

	/**
	 * @param dLicenceDAOI the dLicenceDAOI to set
	 */
	public void setdLicenceDAOI(DLicenceDAOI dLicenceDAOI) {
		this.dLicenceDAOI = dLicenceDAOI;
	}

	/**
	 * @param fcarApllyDAOI
	 *            the fcarApllyDAOI to set
	 */
	public void setFcarApllyDAOI(FcarApllyDAOI fcarApllyDAOI) {
		this.fcarApllyDAOI = fcarApllyDAOI;
	}

	/**
	 * @return the vehicleDAOI
	 */
	public VehicleDAOI getVehicleDAOI() {
		return vehicleDAOI;
	}

	/**
	 * @param vehicleDAOI the vehicleDAOI to set
	 */
	public void setVehicleDAOI(VehicleDAOI vehicleDAOI) {
		this.vehicleDAOI = vehicleDAOI;
	}

	@Override
	public FcarAplly iWantToFInOut(DLicence dLicence, Vehicle vehicle,
			FcarDriver fcarDriver, FcarAplly fcarAplly) {
		// TODO Auto-generated method stub
		try{
			//驾驶证
			dLicenceDAOI.addDLicence(dLicence);
			vehicleDAOI.addVehicle(vehicle);
			fcarDriverDAOI.addFcarDriver(fcarDriver);
			fcarApllyDAOI.addFcarAplly(fcarAplly);
		}
		catch(Exception e){
			e.printStackTrace();
			return null;
		}
		return fcarAplly;
	}

	/**
	 * @return the fcarDriverDAOI
	 */
	public FcarDriverDAOI getFcarDriverDAOI() {
		return fcarDriverDAOI;
	}

	/**
	 * @param fcarDriverDAOI the fcarDriverDAOI to set
	 */
	public void setFcarDriverDAOI(FcarDriverDAOI fcarDriverDAOI) {
		this.fcarDriverDAOI = fcarDriverDAOI;
	}

}
